<template>
  <div class="jsb">
    <el-collapse
      v-model="activeNames"
      @change="handleChange"
      style="margin-top: 10px"
    >
      <el-collapse-item name="1">
        <template slot="title">
          <div>
            <i
              class="el-icon-document"
              style="font-size: 22px; margin-right: 10px"
            ></i>
            <span style="font-weight: 900; font-size: 16px"
              >肺结核患者第一次入户随访表</span
            >
          </div>
        </template>
        <div>
          <el-table
            :data="tableData"
            style="width: 100%; margin-top: 15px"
            :header-cell-style="{
              color: '#000',
              backgroundColor: 'rgb(222,234,255)',
            }"
            height="250"
          >
            <el-table-column prop="date" label="序号"> </el-table-column>
            <el-table-column prop="date" label="创建时间"> </el-table-column>
            <el-table-column prop="date" label="最近更新时间">
            </el-table-column>
            <el-table-column prop="date" label="随访时间"> </el-table-column>
            <el-table-column prop="date" label="随访医生"> </el-table-column>
            <el-table-column prop="date" label="随访机构"> </el-table-column>
            <el-table-column prop="date" label="来源"> </el-table-column>
            <el-table-column prop="date" label="随访项目"> </el-table-column>
            <el-table-column prop="date" label="随访方式"> </el-table-column>
            <el-table-column prop="date" label="随访照片"> </el-table-column>
            <el-table-column
              prop="date"
              label="操作"
              fixed="right"
              width="220"
              align="center"
            >
              <template slot-scope="">
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >下载</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >预览</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >切换类型</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >修改</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-collapse-item>
      <el-collapse-item name="2">
        <template slot="title">
          <div>
            <i
              class="el-icon-document"
              style="font-size: 22px; margin-right: 10px"
            ></i>
            <span style="font-weight: 900; font-size: 16px"
              >肺结核患者随访服务记录表</span
            >
            <el-button
              size="small"
              type="primary"
              icon="el-icon-plus"
              style="position: absolute; right: 8%; margin-top: 8px"
              @click.stop="goto_open('肺结核患者随访服务记录表')"
              >新增随访</el-button
            >
          </div>
        </template>
        <div>
          <el-table
            :data="tableData"
            style="width: 100%; margin-top: 15px"
            :header-cell-style="{
              color: '#000',
              backgroundColor: 'rgb(222,234,255)',
            }"
            height="250"
          >
            <el-table-column prop="date" label="序号"> </el-table-column>
            <el-table-column prop="date" label="创建时间"> </el-table-column>
            <el-table-column prop="date" label="最近更新时间">
            </el-table-column>
            <el-table-column prop="date" label="随访医生"> </el-table-column>
            <el-table-column prop="date" label="随访机构"> </el-table-column>
            <el-table-column prop="date" label="来源"> </el-table-column>
            <el-table-column prop="date" label="随访项目"> </el-table-column>
            <el-table-column prop="date" label="随访照片"> </el-table-column>
            <el-table-column
              prop="date"
              label="操作"
              fixed="right"
              width="220"
              align="center"
            >
              <template slot-scope="">
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >下载</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >预览</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >切换类型</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >修改</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-collapse-item>
      <el-collapse-item name="3">
        <template slot="title">
          <div>
            <i
              class="el-icon-document"
              style="font-size: 22px; margin-right: 10px"
            ></i>
            <span style="font-weight: 900; font-size: 16px"
              >病原学阳性肺结核患者密切接触者症状筛查记录</span
            >
            <el-button
              size="small"
              type="primary"
              icon="el-icon-plus"
              style="position: absolute; right: 8%; margin-top: 8px"
              @click.stop="
                goto_open('病原学阳性肺结核患者密切接触者症状筛查记录')
              "
              >新增随访</el-button
            >
          </div>
        </template>
        <div>
          <el-table
            :data="tableData"
            style="width: 100%; margin-top: 15px"
            :header-cell-style="{
              color: '#000',
              backgroundColor: 'rgb(222,234,255)',
            }"
            height="250"
          >
            <el-table-column prop="date" label="序号"> </el-table-column>
            <el-table-column prop="date" label="创建时间"> </el-table-column>
            <el-table-column prop="date" label="最近更新时间">
            </el-table-column>
            <el-table-column prop="date" label="创建医生"> </el-table-column>
            <el-table-column prop="date" label="创建单位"> </el-table-column>
            <el-table-column prop="date" label="随访项目"> </el-table-column>
            <el-table-column
              prop="date"
              label="操作"
              fixed="right"
              width="220"
              align="center"
            >
              <template slot-scope="">
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >下载</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >预览</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >切换类型</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >修改</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-collapse-item>
      <el-collapse-item name="4">
        <template slot="title">
          <div>
            <i
              class="el-icon-document"
              style="font-size: 22px; margin-right: 10px"
            ></i>
            <span style="font-weight: 900; font-size: 16px"
              >乡镇肺结核患者随访检查记录</span
            >
            <el-button
              size="small"
              type="primary"
              icon="el-icon-plus"
              style="position: absolute; right: 8%; margin-top: 8px"
              @click.stop="goto_open('乡镇肺结核患者随访检查记录')"
              >新增随访</el-button
            >
          </div>
        </template>
        <div>
          <el-table
            :data="tableData"
            style="width: 100%; margin-top: 15px"
            :header-cell-style="{
              color: '#000',
              backgroundColor: 'rgb(222,234,255)',
            }"
            height="250"
          >
            <el-table-column prop="date" label="序号"> </el-table-column>
            <el-table-column prop="date" label="创建时间"> </el-table-column>
            <el-table-column prop="date" label="最近更新时间">
            </el-table-column>
            <el-table-column prop="date" label="随访项目"> </el-table-column>
            <el-table-column
              prop="date"
              label="操作"
              fixed="right"
              width="220"
              align="center"
            >
              <template slot-scope="">
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >下载</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >预览</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >切换类型</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >修改</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  style="background-color: #fff; color: rgb(47, 160, 254)"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-collapse-item>
    </el-collapse>
    <!-- 弹层开始 -->
    <el-dialog
      :title="isTitle"
      :visible.sync="dialogVisible"
      width="96%"
      style="margin-top: -10vh"
      :before-close="handleClose"
      :append-to-body="true"
      :close-on-click-modal="false"
    >
      <div style="height: 65vh; overflow: auto">
        <fjhhzsffwjlb
          v-if="isTitle == '肺结核患者随访服务记录表'"
        ></fjhhzsffwjlb>
        <byxyxfjhhzmqjc
          v-if="isTitle == '病原学阳性肺结核患者密切接触者症状筛查记录'"
        ></byxyxfjhhzmqjc>
        <xzfjhhzsf v-if="isTitle == '乡镇肺结核患者随访检查记录'"></xzfjhhzsf>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">关 闭</el-button>
        <el-button type="primary" @click="dialogVisible = false"
          >保 存</el-button
        >
      </span>
    </el-dialog>
    <!-- 弹层结束 -->
  </div>
</template>
      
      <script>
import fjhhzsffwjlb from "@/views/dialog_info/fjhhzsffwjlb.vue"; // 肺结核患者随访服务记录表
import byxyxfjhhzmqjc from "@/views/dialog_info/byxyxfjhhzmqjc.vue"; // 病原学阳性肺结核患者密切接触者症状筛查记录
import xzfjhhzsf from "@/views/dialog_info/xzfjhhzsf.vue"; // 乡镇肺结核患者随访检查记录
export default {
  components: {
    fjhhzsffwjlb,
    byxyxfjhhzmqjc,
    xzfjhhzsf,
  },
  data() {
    return {
      activeNames: [],
      tableData: [],
      dialogVisible: false,
      isTitle: "",
    };
  },
  methods: {
    handleChange(val) {
    },
    goto_open(title) {
      this.isTitle = title;
      this.dialogVisible = true;
    },
    handleClose() {
      this.dialogVisible = false;
      this.$refs.child.clear_info();
    },
    getList() {
      this.tableData = [];
      var data = {
        idNo: localStorage.getItem('idCard'),
      };
      this.$post("/diabetesServiceVisit/list?idNo=" + data.idNo).then((res) => {
        this.tableData = res.data;
      });
    },
    up_info(item) {
      var init = JSON.stringify(item);
      var body = JSON.parse(init);
      body.symptom = [...body.symptom.toString()];
      body.signFootArterial = [...body.signFootArterial.toString()];
      body.insulinCount = body.insulinCount
        ? [...body.insulinCount.toString()]
        : [];
      body.diabetesServiceChildList = body.diabetesServiceChildList
        ? [...body.diabetesServiceChildList.toString()]
        : [{}];
      this.goto_open();
      setTimeout((_) => {
        this.$refs.child.getInfo(body);
      }, 100);
    },
    del_info(id) {
      this.$post("/diabetesServiceVisit/delete?id=" + id).then((res) => {
        this.getList();
      });
    },
    btn_OK() {
      this.isLoading = true;
      this.$refs.child.btn_ok();
      this.handleClose();
      setTimeout((_) => {
        this.getList();
        this.isLoading = false;
      }, 600);
    },
  },
};
</script>
      
      <style lang="scss" scoped>
.jsb {
}
</style>